package com.zy.ivideo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Data
@ApiModel(value = "回复实体类",description = "回复实体类")
@Table(name = "b_reply")
public class ReplyEntity {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键id",position = 16,example = "0")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id",position = 16,example = "0")
    @Column(nullable = false)
    private int userid;

    @ApiModelProperty(value = "用户昵称",position = 16,example = "小红")
    @Column(name = "nickname",length = 50,columnDefinition = "COMMENT '用户昵称'")
    private String nickname;

    @ApiModelProperty(value = "用户头像",position = 16,example = "http://xx.com/head.img")
    @Column(name = "userlogo",length = 200,columnDefinition = "COMMENT '用户头像'")
    private String userlogo;

    @ApiModelProperty(value = "评论id",position = 16,example = "0")
    @Column(name = "commentid",nullable = false)
    private int commentid;

    @ApiModelProperty(value = "回复内容",position = 16,example = "挺好")
    @Column(name = "content",length = 200,columnDefinition = "COMMENT '回复内容'")
    private String content;

    @ApiModelProperty(value = "状态",position = 16,example = "0")
    @Column(name = "status",length = 2,nullable = false,columnDefinition = "DEFAULT 0 COMMENT '状态'")
    private int status;

    @ApiModelProperty(value = "创建时间",position = 16,example = "2024-01-01 00:00:00")
    @CreatedDate
    @Column()
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createtime;

    @ApiModelProperty(value = "点赞数量",position = 16,example = "200")
    @Column(name = "agreenum",length = 5,columnDefinition = "COMMENT '点赞数量'")
    private int agreenum;


}
